﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DotNet.Entity;

namespace DotNet.JCore.Entity
{
    /// <summary>
    /// 系统稽查登记
    /// </summary>
    [Table("系统稽查登记")]
    public class SystemReg
    {
        /// <summary>
        /// 主键
        /// </summary>
        [PrimaryKey]
        [Column("主键", false)]
        public string Id { get; set; }

        /// <summary>
        /// 车牌号
        /// </summary>
        [Column("车牌号")]
        public string CarNumber { get; set; }

        /// <summary>
        /// 线路
        /// </summary>
        [Column("线路")]
        public string Line { get; set; }

        /// <summary>
        /// 出站时间
        /// </summary>
        [Column("出站时间")]
        public DateTime? ExitTime { get; set; }

        /// <summary>
        /// 运行时间（当前时间-出站时间）
        /// </summary>
        [Column("运行时间")]
        public int RunSecond { get; set; }

        /// <summary>
        /// 售票张数
        /// </summary>
        [Column("售票张数")]
        public string PassengerNumber { get; set; }

        /// <summary>
        /// 核载人数
        /// </summary>
        [Column("核载人数")]
        public string SeatCount { get; set; }

        /// <summary>
        /// 乘客人数
        /// </summary>
        [Column("乘客人数",false)]
        public string ExitNumber { get; set; }

        /// <summary>
        /// 所属客运站
        /// </summary>
        [Column("所属客运站ID", false)]
        public string StationID { get; set; }

        /// <summary>
        /// 所属客运站
        /// </summary>
        [Column("所属客运站",false)]
        public string Station { get; set; }

        /// <summary>
        /// 司机姓名
        /// </summary>
        [Column("司机姓名",false)]
        public string DriverName { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        [Column("联系电话",false)]
        public string DriverPhone { get; set; }

        /// <summary>
        /// 运行状态
        /// </summary>
        [Column("正常", false)]
        public bool RunStatus { get; set; } = true;

        /// <summary>
        /// 运行状态 0正常 1异常
        /// </summary>
        [Ignore]
        [Column("运行状态  0：正常1：异常",false)]
        public string RunStatusText
        {
            get { return RunStatus ? "正常" : "异常"; }
        }

        /// <summary>
        /// 稽查点主键
        /// </summary>
        [Column("稽查点主键", false)]
        public string PointId { get; set; }

        /// <summary>
        /// 稽查点名称
        /// </summary>
        [Column("稽查点名称")]
        public string PointName { get; set; }

        /// <summary>
        /// 创建者主键
        /// </summary>
        [Column("创建者主键")]
        public string CreateId { get; set; }

        /// <summary>
        /// 创建者姓名
        /// </summary>
        [Column("创建者姓名",false)]
        public string CreateName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("创建时间")]
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 运输企业
        /// </summary>
        [Column("运输企业",false)]
        public string Corp { get; set; }

        /// <summary>
        /// 登记类型
        /// </summary>
        [Column("系统", false)]
        public int RegType { get; set; }

        /// <summary>
        /// 登记类型
        /// </summary>
        //[Column("系统", false)]
        //public bool RegType { get; set; } = true;

        /// <summary>
        /// 0：系统1：自动
        /// </summary>
        //[Ignore]
        //[Column("登记类型")]
        //public string RegTypeText
        //{
        //    get { return RegType ? "自动" : "系统"; }
        //}

        /// <summary>
        /// 稽查状态
        /// </summary>
        [Column("正常", false)]
        public bool CheckStatus { get; set; } = true;
        /// <summary>
        /// 0：正常1：违规
        /// </summary>
        [Ignore]
        [Column("稽查状态")]
        public string CheckStatusText
        {
            get { return CheckStatus ? "违规" : "正常"; }
        }

        /// <summary>
        /// 处理结果
        /// </summary>
        [Column("未处理", false)]
        public bool ProcessStatus { get; set; } = true;
        /// <summary>
        /// 处理结果：0-未处理 1-已处理
        /// </summary>
        [Ignore]
        [Column("处理结果",false)]
        public string ProcessStatusText
        {
            get { return ProcessStatus ? "已处理" : "未处理"; }
        }

        /// <summary>
        ///  违规类型:0-人数不符 1-时间不符 2-未经过检查点 3-资质不符 4-其他
        /// </summary>
        [Column("违规类型ID",false)]
        public string OffenceId { get; set; }

        /// <summary>
        /// 违规类型
        /// </summary>
        [Column("违规类型")]
        public string OffenceName { get; set; }

        /// <summary>
        /// 状态 0无效 1有效
        /// </summary>
        [Column("状态", false)]
        public bool Enabled { get; set; } = true;

        /// <summary>
        /// 有效状态 0无效 1有效
        /// </summary>
        [Ignore]
        [Column("状态",false)]
        public string EnabledText
        {
            get { return Enabled ? "有效" : "无效"; }
        }

        /// <summary>
        /// 备注
        /// </summary>
        [Column("备注",false)]
        public string Note { get; set; }

        /// <summary>
        /// 复制对象
        /// </summary>
        public SystemReg Clone()
        {
            return (SystemReg)MemberwiseClone();
        }
    }
}
